<template>
    <div class="RiskRelease">
        <div v-if="showList" style="height: 100%; padding: 6px 10px;">
            <div style="margin-top: 10px">
                <van-search v-model="searchData.taskName" style="border-radius: 10px; height: 44px" background="#f7f8fa"
                    placeholder="请输入风险名称" @search="getchaXun" />
            </div>
            <div class="riskRelease-middle1" :style="name == '乡镇' ? 'height:91vh' : ''" v-show="tableData.length > 0"
                ref="riskReleaseMiddle1">
                <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="init">
                    <van-cell v-for="(item, index) in tableData" :key="index" @click="see(item)"
                        style="border-radius: 10px;margin-top: 14px;">
                        <ul class="riskRelease-middle">
                            <li class="riskRelease-middle2">
                                <div @click.stop="stopPropagation($event)"> <van-checkbox v-model="item.checked"
                                        icon-size="15px" shape="square" @change="changeVal">{{ item.taskName
                                        }}</van-checkbox></div>
                                <template v-if="name == '签收'">
                                    <span :style="item.signStatus == 0 ? 'color: #0272D4;cursor: pointer;' : ''"
                                        @click.stop="item.signStatus == 0 ? Signfor(item) : ''"> {{ item.signStatus |
                                            inUseName(Enum.QSZT) }} </span>
                                </template>
                                <template v-else>
                                    <span style="float: right;white-space: nowrap;">{{ item.riskRemove |
                                        inUseName(Enum.DQZT) }} </span>
                                </template>
                            </li>
                            <li class="riskRelease-middle3">
                                风险编号：{{ item.taskNo }}
                            </li>
                            <li class="riskRelease-middle3">
                                风险发布时间：{{ item.createDate }}
                                <span style="float: right;">{{ item.riskLevel | inUseName(Enum.FXDJ) }} </span>
                            </li>
                            <li class="riskRelease-middle4">
                                风险上报截止时间：{{ item.deadline }}
                            </li>
                            <li class="riskRelease-middle4" v-if="name == '市'">
                                关联风险名称：{{ item.relationName ? item.relationName : '' }}
                            </li>
                            <li class="riskRelease-middle4 active" v-if="name == '市'">
                                <span @click.stop="signDetail('区县已签收', item.signs)">区县已签收：{{ item.signNum }}</span>
                                <span style="float: right;" @click.stop="signDetail('区县未签收', item.unSigns)">区县未签收：{{
                                    item.unSignNum }} </span>
                            </li>
                            <li class="riskRelease-middle4 active" v-if="name == '省'">
                                <span @click.stop="signDetail('已签收', item.signs)">已签收：{{ item.signNum }}</span>
                                <span style="float: right;" @click.stop="signDetail('未签收', item.unSigns)">未签收：{{
                                    item.unSignNum }} </span>
                            </li>
                            <li class="riskRelease-middle4" v-if="name !== '省'">
                                当前状态：{{ item.typeStr }}
                            </li>
                        </ul>
                    </van-cell>
                </van-list>

            </div>
            <div v-show="tableData.length == 0" style="height: 84vh; text-align: center; padding-top: 20vh">
                <div style="margin-bottom: 10px">
                    <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png" />
                </div>
                <div>暂无数据</div>
            </div>
            <div class="riskRelease-footer">
                <van-button color="dodgerblue" v-if="name == '省' || name == '市'" @click="add()">新增</van-button>
                <van-button color="dodgerblue" v-if="name == '市'" @click="Signfor()">签收与发布</van-button>
                <van-button color="dodgerblue" block style="width:100%" v-if="name == '区县'"
                    @click="SignforQX()">签收与发布</van-button>
                <van-button color="dodgerblue" v-if="name == '市'" @click="riskCorrelation()">风险关联</van-button>
                <van-button color="dodgerblue" v-if="name == '省' || name == '市'" @click="end()">结束</van-button>
            </div>
        </div>
        <template v-else>
            <div class="bigformWrap" v-if="!retType">
                <p style="margin:10px">
                    <van-button @click="backHomepage" size="small" type="info">返回上一级</van-button>
                </p>
                <!-- 新增 -->
                <template v-if="status == 'add' || status == 'see'">
                    <p class="title">风险发布管理</p>
                    <div class="jbxx">
                        <risk-release-add :disabled="status == 'see'" :rowData="rowData"
                            :cityLevel="name"></risk-release-add>
                    </div>
                </template>
                <!-- 签收与发布 -->
                <template v-if="status == 'sign'">
                    <p class="title">风险发布管理</p>
                    <div class="jbxx">
                        <p class="subTitle">省级风险预警</p>
                        <risk-release-add :status="status" :rowData="rowData" :disabled="true"></risk-release-add>
                    </div>
                    <div class="jbxx">
                        <p class="subTitle">地市风险签收及发布</p>
                        <div class="formWrap">
                            <van-form>
                                <van-field label="地市签收意见" name="signAdvice" type="textarea" rows="4" autosize
                                    v-model="formData.signAdvice" placeholder="请输入" />
                                <van-field readonly label="风险签收人" name="signPerson" v-model="formData.signPerson"
                                    placeholder="请输入" />
                                <van-field readonly label="风险签收时间" name="signTime" v-model="formData.signTime"
                                    placeholder="请输入" />
                                <van-field required clickable name="picker" :value="formData.FBHGL" label="发布或关联风险"
                                    placeholder="请选择" @click="Enum.ISFXGL = true" />
                                <van-popup v-model="Enum.ISFXGL" position="bottom" get-container="#popup">
                                    <van-picker show-toolbar :columns="Enum.FXGL" value-key="name" @confirm="onConfirm1"
                                        @cancel="Enum.ISFXGL = false" />
                                </van-popup>
                            </van-form>
                            <p style="padding:0 10px">
                                <template v-if="formData.FBHGL == '发布风险'">
                                    <van-button slot="button" type="info" size="small"
                                        @click="onClickAccess()">一键获取省级风险预警</van-button>
                                </template>
                                <template v-if="formData.FBHGL == '关联地市风险'">
                                    <van-button slot="button" type="info" size="small"
                                        @click="retrievalCity()">关联</van-button>
                                    <van-button slot="button" type="info" size="small"
                                        @click="seeRetrieval()">查看</van-button>
                                </template>
                            </p>
                        </div>
                        <risk-release-add @save="SignforSave" v-if="formData.FBHGL == '发布风险'" :rowData="form"
                            :cityLevel="'市'"></risk-release-add>
                        <p style="margin-top:10px;text-align: center;margin-bottom: 10px;"
                            v-if="!formData.FBHGL || formData.FBHGL == '关联地市风险'">
                            <van-button block type="info" @click="SignforSave()">确定</van-button>
                        </p>
                    </div>
                </template>
                <!-- 风险关联 -->
                <template v-if="status == 'relation'">
                    <p class="title">风险关联</p>
                    <div class="jbxx">
                        <p class="subTitle">风险发布信息</p>
                        <risk-release-add :rowData="rowData" :disabled="true" :cityLevel="'市'"></risk-release-add>
                    </div>
                    <div class="jbxx">
                        <p class="subTitle">关联风险信息</p>
                        <div class="formWrap">
                            <van-form>
                                <van-field required true label="风险名称" name="taskName" v-model="relationFrom.taskName">
                                    <van-button slot="button" type="info" size="small" @click="retrieval()"
                                        style="margin-right:10px">关联</van-button>
                                    <van-button slot="button" type="info" size="small"
                                        @click="seeRetrieval()">查看</van-button>
                                </van-field>
                            </van-form>
                        </div>
                    </div>
                    <p style="text-align: center;padding: 10px">
                        <van-button block type="info" @click="relationSave()">确定</van-button>
                    </p>
                </template>
            </div>
            <retrieval v-else @close="close" @retrievalSure="retrievalSure" :type="retType"></retrieval>
        </template>
        <van-popup class="popupDialog" v-model="show">
            <div class="dialog-title-text">签收与发布</div>
            <van-form validate-firstm>
                <van-field label="区县签收意见" name="signAdvice" type="textarea" rows="4" autosize v-model="formData.signAdvice"
                    placeholder="请输入" />
                <van-field readonly label="风险签收人" name="signPerson" v-model="formData.signPerson" placeholder="请输入" />
                <van-field readonly label="风险签收时间" name="signTime" v-model="formData.signTime" placeholder="请输入" />
                <p class="buttonfooter">
                    <van-button size="small" color="dodgerblue" @click="SignforSave2()">确定</van-button>
                    <van-button size="small" color="dodgerblue" @click="show = false">取消</van-button>
                </p>
            </van-form>
        </van-popup>
        <van-popup class="popupDialog" closeable v-model="show1">
            <div class="dialog-title-text">{{ title1 }}</div>
            <div class="riskRelease-middle1" v-show="tableData.length > 0" ref="riskReleaseMiddle1">
                <van-list finished-text="没有更多了">
                    <van-cell v-for="(item, index) in tableData1" :key="index"
                        style="border-radius: 10px;margin-top: 14px;">
                        <ul class="riskRelease-middle">
                            <li class="riskRelease-middle2">
                                {{ item.cityName }}
                            </li>
                            <li class="riskRelease-middle3">
                                签收时间：{{ item.signTime }}
                            </li>
                            <li class="riskRelease-middle3">
                                签收意见：{{ item.signAdvice }}
                            </li>
                        </ul>
                    </van-cell>
                </van-list>
            </div>
        </van-popup>
        <van-popup class="popupDialog" closeable v-model="show3">
            <div class="dialog-title-text">查看</div>
            <div style="width:100%;height:60vh;overflow: scroll;">
                <risk-release-add :disabled="true" :rowData="relationFrom" :cityLevel="name"></risk-release-add>
            </div>
        </van-popup>
        <van-popup class="popupDialog" closeable v-model="show4">
            <div class="dialog-title-text">风险重复上报提醒</div>
            <div style="padding:10px">
                <p style="line-height: 30px;margin-bottom:10px">
                    提示：您关联的当前省级风险已发布至{{ cityCodemsg }}进行风险处置，本地市的风险也发布至{{ cityCodemsg }}进行风险处置，请选择需要上报省级的风险</p>
                <van-radio v-model="radio" name="1"><span style="font-size:18px">上报省级发布至{{ cityCodemsg }}的风险</span></van-radio>
                <van-radio v-model="radio" name="2" style="margin-top:10px"><span style="font-size:18px">上报本地市发布至{{ cityCodemsg }}的风险</span></van-radio>
                <p style="margin-top:20px;text-align: center;margin-bottom: 10px;">
                    <van-button block type="info" @click="unsignArea()">确定</van-button>
                </p>
            </div>
        </van-popup>
    </div>
</template>
<script>
import axios from "axios";
import dd from 'gdt-jsapi';
import RiskReleaseAdd from './RiskReleaseAdd.vue'
import Retrieval from "./children/Retrieval" //风险关联
import { Dialog } from 'vant';
export default {
    name: "RiskRelease",
    data() {
        return {
            BaseUrl: window.g.BaseURL,
            name: "",
            retType: "",
            radio:'1',
            showList: true,
            cityCodemsg:"",
            show: false,
            show1: false,
            show3: false,
            show4: false,
            loading: false,
            disabled: false,
            finished: false,
            title1: "",
            multipleSelection: [],
            relationFrom: {},
            rowData: {},
            status: "add",
            form: {},
            formData: {
                signAdvice: null,
                cityCode: window.localStorage.getItem("citycode"),
                signPerson: JSON.parse(window.localStorage.getItem('userName')).userName,
                taskCreatePersonId: "",
                signTime: this.getDate(),
            },
            column: [{
                label: "风险名称",
                prop: "taskName"
            }, {
                label: "风险级别",
                prop: "riskLevel"
            }, {
                label: "发布单位",
                prop: "issueUnit"
            }, {
                label: "风险处置要求",
                prop: "riskDealRequire"
            }, {
                label: "风险上报截止时间",
                prop: "deadline"
            }, {
                label: "风险发布时间",
                prop: "createDate"
            }, {
                label: "操作人",
                prop: "taskCreatePersonName"
            }],
            tableData: [],
            tableData1: [],
            searchData: {
                taskName: '',
                riskRemove: ''
            },
            Enum: {
                FXDJ: [
                    {
                        name: 'Ⅰ级',
                        value: 0
                    },
                    {
                        name: 'Ⅱ级',
                        value: 1
                    },
                    {
                        name: 'Ⅲ级',
                        value: 2
                    },
                    {
                        name: 'Ⅳ级',
                        value: 3
                    },
                    {
                        name: 'Ⅴ级',
                        value: 4
                    }
                ],
                DQZT: [{
                    name: "运行",
                    value: 0
                }, {
                    name: "结束",
                    value: 1
                }],
                QSZT: [{
                    name: "签收",
                    value: 0
                }, {
                    name: "已签收",
                    value: 1
                }, {
                    name: "结束",
                    value: 2
                }],
                ISFXGL: false,
                FXGL: [{
                    name: "发布风险",
                    value: "发布风险",
                }, {
                    name: "关联地市风险",
                    value: "关联地市风险"
                }],
            },
            pageSize: 15,
            total: 0,
            pageNum: 0,
            cityCode: "",
        }
    },
    filters: {
        inUseName: function (msg, data) {
            let name = ''
            data.forEach(item => {
                if (item.value == msg) {
                    name = item.name
                }
            })
            return name
        },
    },
    components: { Retrieval, RiskReleaseAdd },
    mounted() {
        console.log(this)
        let name = this.$route.query.name;
        this.name = name;
        this.type = this.$route.query.type;
        dd.ready(() => {
            dd.setTitle({
                title: '风险' + this.$route.query.title,
            }).then((res) => {

            }).catch((err) => {
                console.error(err)
            })
        })
        this.init()
    },
    methods: {
        backHomepage() {
            this.showList = true;
            this.getchaXun();
        },
        onConfirm1(value) {
            debugger
            this.formData.FBHGL = value.value;
            this.Enum.ISFXGL = false;
        },
        init() {
            this.pageNum++;
            this.getData()
            // if (this.name == '签收' || this.type == '风险签收') {
            //     this.getDataSignfor()
            // } else {

            // }
        },
        // 点击复选框阻止冒泡
        stopPropagation(e) {
            e.stopPropagation();
        },
        // 复选框选中
        changeVal(val) {
            console.log(val)
            this.multipleSelection = [];
            this.tableData.forEach(item => {
                if (item.checked) {
                    this.multipleSelection.push(item)
                }
            })
        },
        //签收列表详情
        signDetail(title, tableData) {
            this.title1 = title;
            this.tableData1 = tableData;
            if (tableData.length > 0) {
                this.show1 = true;
            } else {
                this.$toast.fail("暂无数据")
            }
        },
        //查询
        getchaXun() {
            this.pageNum = 0;
            this.tableData = []
            this.init()
        },
        handleSelectionChange(val) {
            this.multipleSelection = val;
        },
        //结束
        end: async function () {
            if (this.multipleSelection.length == 1) {
                let url = 'api/farmerHouse/housePreventTaskSign/riskRemove/';
                let obj = {}
                if (this.multipleSelection[0].riskRemove == 1) {
                    this.$toast.fail("当前状态已经结束")
                    return false
                }
                let webResult = await axios.post(this.BaseUrl + url + this.multipleSelection[0].id, obj, {
                    headers: {
                        isOutParam: true,
                    },
                });
                if (webResult.data.data) {
                    this.$toast.success("成功")
                    this.getchaXun()
                } else {
                    this.$toast.fail("失败")
                }
            } else {
                this.$toast.fail('请选择一条数据进行操作');
            }
        },
        //新增
        add() {
            this.rowData = {};
            this.retType = "";
            this.status = 'add'
            this.disabled = false;
            this.showList = false;
            // this.$router.push({
            //     path: '/RiskReleaseAdd',
            //     query: {
            //         name: "发布新增" //用于区分从哪个按钮进入
            //     }
            // })
        },
        // 查看
        see: async function (item) {
            this.rowData = item;
            this.retType = "";
            this.status = 'see'
            this.disabled = true;
            this.showList = false;
        },
        // 签收
        Signfor(row) {
            if (this.multipleSelection.length == 1) {
                if (this.multipleSelection[0].typeStr == "未签收") {
                    let p = new Promise((resolve, reject) => {
                        // axios.post(`${this.BaseUrl}/api/farmerHouse/housePreventTaskSign/relationCheck?relationTaskNo=${this.multipleSelection[0].taskNo}&cityCode=${this.multipleSelection[0].cityCode}`, {}, {
                        //     headers: {
                        //         isOutParam: true,
                        //     },
                        // }).then(res => {
                        //     if (res.data.data) {
                        //         resolve(true)
                        //     } else {
                        //         Eca.MessageBox.ShowQuestion(res.data.msg, function () {
                        //             resolve(true)
                        //         }, function () { console.log('执行了取消') });
                        //     }
                        // })
                        if (this.multipleSelection[0].relationName || this.multipleSelection[0].relationTaskNo) {
                            Dialog.confirm({
                                title: '提示',
                                message: '当前地市已经关联该省级风险，是否重新关联？',
                                confirmButtonText: '确定',
                                cancelButtonText: '取消'
                            })
                                .then(() => {
                                    resolve(true)
                                })
                                .catch(() => {
                                    // on cancel
                                });
                        } else {
                            resolve(true)
                        }
                    })
                    p.then(res => {
                        this.rowData = this.multipleSelection[0];
                        this.status = "sign";
                        this.retType = "";
                        this.formData['signAdvice'] = "";
                        this.$set(this.formData, 'FBHGL', null);
                        this.form = {
                            cityCode: window.localStorage.getItem("citycode"),
                            signType: "人工发布",
                            taskCreatePersonName: JSON.parse(window.localStorage.getItem('userName')).userName,
                            taskCreatePersonId: "",
                            createDate: this.getDate(),
                            relationTaskNo: this.rowData.taskNo,
                            relationName: this.rowData.taskName
                        }
                        setTimeout(() => {
                            this.showList = false;
                        }, 500)
                    })
                } else {
                    this.$toast.fail('只能签收并发布省级风险');
                }
            } else {
                this.$toast.fail('请选择一条数据进行操作');
            }
        },
        SignforQX() {
            if (this.multipleSelection.length == 1) {
                if (this.multipleSelection[0].typeStr == "未签收") {
                    this.rowData = this.multipleSelection[0];
                    this.formData['signAdvice'] = "";
                    this.show = true
                } else {
                    this.$toast.fail('只能签收并发布省级风险');
                }
            } else {
                this.$toast.fail('请选择一条数据进行操作');
            }
        },
        //签收确定
        SignforSave: async function (status) {
            if (this.formData.FBHGL == "关联地市风险") {
                if (!this.relationFrom.taskNo) {
                    this.$message.info("请选择关联的风险")
                    return false
                } else {
                    this.relationSave()
                }
            }
            let data = JSON.parse(JSON.stringify(this.multipleSelection[0]));
            data.signAdvice = this.formData.signAdvice;
            data.signPerson = this.formData.signPerson;
            data.signTime = this.formData.signTime;
            data.signStatus = 1;
            axios.post(this.BaseUrl + '/api/farmerHouse/housePreventTaskInfo/taskReceive', data, {
                headers: {
                    isOutParam: true,
                },
            }).then(res => {
                if (res.data.data) {
                    if (this.show) {
                        this.show = false
                        this.$toast.success("签收成功");
                        this.getchaXun()
                    }
                } else {
                    this.$toast.fail(res.data.msg)
                }
            })
        },
        // 区县签收确定
        SignforSave2: async function (status) {
            let data = JSON.parse(JSON.stringify(this.multipleSelection[0]));
            data.signAdvice = this.formData.signAdvice;
            data.signPerson = this.formData.signPerson;
            data.signTime = this.formData.signTime;
            data.signStatus = 1;
            // 先签收后发布
            let p = new Promise((resolve, reject) => {
                axios.post(this.BaseUrl + '/api/farmerHouse/housePreventTaskInfo/taskReceive', data, {
                    headers: {
                        isOutParam: true,
                    },
                }).then(res => {
                    if (res.data.code == 200) {
                        resolve(true)
                    } else {
                        this.$toast.fail(res.data.msg)
                    }
                })

            })
            p.then(res => {
                let url = '/api/farmerHouse/housePreventTaskInfo/signTask';
                let form = JSON.parse(JSON.stringify(this.rowData));
                form.relationTaskNo = this.rowData.taskNo;
                form.relationName = this.rowData.taskName;
                form.cityCodes = [];
                form.cityCode = localStorage.getItem('citycode');
                axios.post(this.BaseUrl + url, form, {
                    headers: {
                        isOutParam: true,
                    },
                }).then(webResult => {
                    if (webResult.data.data) {
                        this.$toast.success("成功");
                        this.show = false;
                        this.getchaXun()
                    } else {
                        this.$toast.fail(webResult.data.msg);
                    }
                });

            })
        },
        //一键获取省级风险
        onClickAccess() {
            //可以获取省级发布风险名称、风险名称、风险级别、风险上报截止时间、风险处置要求字段信息
            this.form = JSON.parse(JSON.stringify(this.rowData));
            this.form.cityCodes = [];
            this.form.cityCode = localStorage.getItem('citycode');
            this.form.taskNo = null;
            this.form.relationTaskNo = this.rowData.taskNo;
            this.form.relationName = this.rowData.taskName;
        },
        //关联
        retrieval() {
            this.retType = "全部";
            this.showList = false;
        },
        //关联地市
        retrievalCity() {
            this.retType = "地市";
            this.showList = false;
        },
        // 风险关联
        riskCorrelation() {
            if (this.multipleSelection.length == 1) {
                // if (this.multipleSelection[0].relationName) {
                //     Eca.Message.Warning('当前数据已关联风险不可重复关联');
                // } else {
                this.rowData = this.multipleSelection[0];
                this.relationFrom = {};
                this.status = "relation"
                this.retType = "";
                setTimeout(() => {
                    this.showList = false;
                }, 500)
                // }
            } else {
                this.$toast.fail('请选择一条数据进行操作');
            }

        },
        // 风险关联确定
        relationSave: async function (type) {
            let _this = this;
            let url = `${this.BaseUrl}api/farmerHouse/housePreventTaskSign/relation`;
            if (this.status == 'sign') {
                url += `?taskNo=${this.relationFrom.taskNo}&relationTaskNo=${this.rowData.taskNo}`
            } else {
                url += `?taskNo=${this.rowData.taskNo}&relationTaskNo=${this.relationFrom.taskNo}`
            }
            type ? url += "&type=1" : "";
            axios.post(url, {}, {
                headers: {
                    isOutParam: true,
                },
            }).then(res => {
                if (res.data.data) {
                    this.show4 = false;
                    this.$toast.success("关联成功")
                    this.backHomepage()
                } else {
                    if (res.data.msg.indexOf('关联') != -1) {
                        Dialog.confirm({
                            title: '提示',
                            message: res.data.msg,
                            confirmButtonText: '确定',
                            cancelButtonText: '取消'
                        }).then(() => {
                            _this.relationSave('type')
                        }).catch(() => { });
                    } else {
                        this.cityCodemsg = res.data.msg;
                        this.show4 = true
                    }

                }
            })
        },
        //记录非发布区域
        unsignArea: async function () {
            
            let p = new Promise((resolve, reject) => {
                axios.get(
                    `${this.BaseUrl}/api/farmerHouse//housePreventTaskInfo/unsignArea`,
                    {
                        params: {
                            taskNo: this.radio == 1 ?this.relationFrom.taskNo:this.rowData.taskNo,
                            cityCode: this.cityCodemsg,
                        },
                        headers: {
                            "isOutParam": true,
                            "isOutParamS": true
                        }

                    }).then(res => {
                        if (res.data.data) {
                            resolve(true)
                        } else {
                            this.$toast.fail(res.data.data.msg)
                        }
                    })
            })
            p.then((res) => {
                this.relationSave('type')
            })
        },
        // 关联风险确定
        retrievalSure(row) {
            this.retType = "";
            this.relationFrom = row;
        },
        // 查看关联详情
        seeRetrieval() {
            if (this.relationFrom.taskName) {
                this.show3 = true
            } else {
                this.$toast.fail('请关联后查看');
            }
        },
        // 关联风险关闭
        close() {
            this.showList = true;
        },
        // 发布数据
        getData: async function () {
            this.loading = true;
            axios.get(
                `${this.BaseUrl}api/farmerHouse/housePreventTaskInfo/selectSignTask`, {
                params: {
                    pageNum: this.pageNum,
                    pageSize: this.pageSize,
                    cityCode: window.localStorage.getItem("citycode"),
                    taskName: this.searchData.taskName,
                },
                headers: {
                    "isOutParam": true,
                    "isOutParamS": true
                }
            }).then(res => {
                this.loading = false;
                if (res.data.code == 200) {
                    res.data.data.pageList.forEach(item => {
                        this.$set(item, 'checked', false)
                        this.tableData.push(item)
                    })
                    this.total = res.data.data.totalCount;
                    // 数据全部加载完成
                    if (this.tableData.length >= this.total) {
                        this.finished = true;
                    }
                } else {
                    this.$toast.fail(res.data.data.msg)
                }
            })
        },
    },
    beforeDestroy() { }
}
</script>
<style lang="scss" scoped>
.RiskRelease {
    height: 100vh;
    overflow: auto;
    background: #eee;
    width: 100vw;
    font-family: 黑体;
    font-size: 18px;

    .title {
        width: 100%;
        height: 46px;
        text-align: center;
        color: #000;
        font-weight: bold;
        font-size: 20px;
    }

    .subTitle {
        width: 100%;
        height: 40px;
        line-height: 40px;
        font-weight: bold;
        padding-left: 10px;
        font-size: 16px;
        color: #000;
    }

    .active {
        color: #0272D4 !important;
        cursor: pointer;
    }

    .riskRelease-footer {
        width: 99%;
        margin-top: 4px;
        margin: 0 auto;
        padding-top: 12px;
        display: flex;
        justify-content: space-between;

        .van-button {
            width: 47%;
            margin: 5px;
        }

        .van-button--normal {
            padding: 0;
        }
    }

    .riskRelease-middle1 {
        height: 84vh;
        overflow: auto;

        .riskRelease-middle {
            background-color: #fff;
            width: 98%;
            margin: 0 auto;

            .riskRelease-middle2 {
                font-size: 18px;
                font-weight: 1000;
                color: black;
                line-height: 36px;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }

            .riskRelease-middle3 {
                font-size: 14px;
                color: #aaa;
                line-height: 24px;
                clear: both;
                overflow: hidden;
            }

            .riskRelease-middle4 {
                font-size: 14px;
                color: #aaa;
                line-height: 24px;

            }
        }
    }
}
</style>
<style lang="scss">
.RiskRelease {
    .bigformWrap {
        width: 100%;
        height: 100vh;
        overflow: auto;
        background: #ffffff;

        .van-field__control {
            text-align: right !important;
        }
    }

    .van-field__label {
        color: #000;
        font-size: 14px;
    }

    .van-field__label {
        width: auto !important;
    }

    .van-tag {
        padding: 10px;
        margin: 10px;
    }

    .popupDialog {
        width: 300px;
        border-radius: 11px;
        background-color: #fff;

        .dialog-title-text {
            line-height: 40px;
            text-align: center;
            border-bottom: 1px solid #ccc;
        }

        .van-field__control {
            text-align: right !important;
        }

        .buttonfooter {
            padding: 10px;
            margin-top: 4px;
            display: flex;
            justify-content: space-between;

            .van-button {
                width: 47%;
            }
        }
    }
}</style>

